﻿@model KnowledgeCommunity.Model.Document

@{
    ViewBag.Title = "编辑";
    Layout = "~/Views/Shared/_Layout_zone.cshtml";
}
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>


<div class="contentcontainer">
    <div class="headings">
        <h2>编辑</h2>
    </div>
    <div class="contentbox">
        @using (Html.BeginForm("Edit", "Document", FormMethod.Post, new { enctype = "multipart/form-data" }))
        {
            @Html.ValidationSummary(true)
            @Html.HiddenFor(model => model.Id)

            <table>
                <tr>
                    <th width="120px">&nbsp; 文档名称（*）</th>
                    <td>
                      @Html.TextBoxFor(model => model.Title, new { @class = "myInput_text" })
                      @Html.ValidationMessageFor(model => model.Title)
                    </td>
                </tr>
                <tr>
                    <th width="120px">&nbsp; 文档价值（*）</th>
                    <td>
                      @Html.TextBoxFor(model => model.Value, new { @class = "myInput_text" })
                      @Html.ValidationMessageFor(model => model.Value)
                    </td>
                </tr>
                <tr>
                    <th>文档类型</th>
                    <td>
                        @Enum.GetName(typeof(KnowledgeCommunity.Service.Enum.DocSort),Convert.ToInt32(Model.FirstClass))
                        @{
                             List<SelectListItem> selectList = new List<SelectListItem>();
                             selectList.Add(new SelectListItem { Text = "--请文档类型--", Value = "0", Selected = true });
                             foreach (object e in Enum.GetValues(typeof(KnowledgeCommunity.Service.Enum.DocSort)))
                             {
                                 selectList.Add(new SelectListItem { Text = Enum.GetName(typeof(KnowledgeCommunity.Service.Enum.DocSort), e), Value = ((int)e).ToString() });
                             }
                             @Html.DropDownList("DocSort", selectList);
                         } 
                    </td>
                </tr>
                <tr>
                    <th>文档属性</th>
                    <td>
                        @Enum.GetName(typeof(KnowledgeCommunity.Service.Enum.IsPublic),Model.IsPublic)
                        @{
                             List<SelectListItem> pselectList = new List<SelectListItem>();
                             foreach (object e in Enum.GetValues(typeof(KnowledgeCommunity.Service.Enum.IsPublic)))
                             {
                                 pselectList.Add(new SelectListItem { Text = Enum.GetName(typeof(KnowledgeCommunity.Service.Enum.IsPublic), e), Value = ((int)e).ToString() });
                             }
                             @Html.DropDownList("Ispublic", pselectList);
                         } 
                    </td>
                </tr>
                <tr>
                   <th>文档简介(*)</th>
                   <td>
                    @Html.TextAreaFor(model => model.Content, new { @class = "myInput_area_slider" })
                    @Html.ValidationMessageFor(model => model.Content)
                   </td>
                </tr>
                <tr>
                   <th>更新文档</th>
                   <td>
                    <input type="file" id="d_file" name="logofile" />
                   </td>
                </tr>
                <tr>
                   <th></th>
                   <td>
                    <input type="button" title="取消" value="<< 返回" id="GoBackList" onclick="history.go(-1)" />
                    <input class="btn" id="_save" title="保存" value="确定保存 >>" type="submit" />
                   </td>
                </tr>
            </table>
         }  
        <div style="clear: both;"></div>
    </div>
</div>

<script type="text/javascript">
    CKEDITOR.replace('Content');
</script>



